package com.hyz.controller;

import com.hyz.model.dto.ApprovalResultRequest;
import com.hyz.model.vo.AssetSecondmentResponse;
import com.hyz.service.permission.FinancialService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import pojo.ResponseResult;

import java.util.List;

/**
 * @author HGD
 * @date 2022/10/10 0:00
 */
@Api("财务人员")
@RequestMapping("/financial")
@RestController
@PreAuthorize("hasAnyAuthority('rights','financial')")
public class FinancialController {
    @Autowired
    private FinancialService service;

    @ApiOperation("财务人员获取资产调用申请")
    @PostMapping("/flGetAssetSecondments")
    public ResponseResult<List<AssetSecondmentResponse>> flGetAssetSecondments() {
        return service.flGetAssetSecondments();
    }

    @ApiOperation("财务人员审批借调申请")
    @PostMapping("/clUpdateAssetSecondment")
    public ResponseResult<List<AssetSecondmentResponse>> flUpdateAssetSecondment(@RequestBody ApprovalResultRequest request) {
        return service.flUpdateAssetSecondment(request);
    }


}
